/*
 * Talk.h
 *
 *  Created on: 31/01/2011
 *      Author: Nenem
 */

#ifndef TALK_H_
#define TALK_H_

#define LINE_SIZE 64
#define N_LINE 5

#include <string>
using namespace std;

#include "Tools.h"
#include "Position.h"
#include "Direction.h"

class Talk {
private:
	bool hasListener;

	Information east;
	Information north;
	Information south;
	Information west;

	string text;
	int begin;
	int counter;
	bool finished;
	bool enabled;

	Direction *direction;
	Position *position;

	int owner;
public:
	Talk();
	Talk(string text);
	virtual ~Talk();

	Rectangle getTalkArea(Position *position, Direction *direction);

	int getX1(Point2D point, Direction *direction);
	int getX2(Point2D point, Direction *direction);
	int getY1(Point2D point, Direction *direction);
	int getY2(Point2D point, Direction *direction);
	string getText();
	void update();
	void reset();

    int getOwner() const
    {
        return owner;
    }

    void setOwner(int owner)
    {
        this->owner = owner;
    }

    bool getFinished() const
    {
        return finished;
    }

    void setFinished(bool finished)
    {
        this->finished = finished;
    }

    Information getEast() const
    {
        return east;
    }

    Information getNorth() const
    {
        return north;
    }

    Information getSouth() const
    {
        return south;
    }

    Information getWest() const
    {
        return west;
    }

    void setEast(Information east)
    {
        this->east = east;
    }

    void setNorth(Information north)
    {
        this->north = north;
    }

    void setSouth(Information south)
    {
        this->south = south;
    }

    void setWest(Information west)
    {
        this->west = west;
    }

    bool getHasListener() const
    {
        return hasListener;
    }

    void setHasListener(bool hasListener)
    {
        this->hasListener = hasListener;
    }

    Direction *getDirection() const
    {
        return direction;
    }

    Position *getPosition() const
    {
        return position;
    }

    void setDirection(Direction *direction)
    {
        this->direction = direction;
    }

    void setPosition(Position *position)
    {
        this->position = position;
    }

};

#endif /* TALK_H_ */
